// 导入vue
import Vue from 'vue';
// 导入VueRouter
import VueRouter from 'vue-router';
// use一下
Vue.use(VueRouter);

// 导入组件
import login from './components/login.vue';
// import index from './components/index.vue';
//嵌套路由的组件
//客户管理相关页面
import myCustomer from './components/Customer/myCustomer.vue';
// import UnhandleM from './components/Customer/UnhandleM.vue';
import customerList from './components/Customer/customerList.vue';
// import redistribution from './components/Customer/redistribution.vue';
// import UnhandleR from './components/Customer/UnhandleR.vue';
import teamCus from './components/Customer/teamCus.vue';
// import UnhandleT from './components/Customer/UnhandleT.vue';
// import customerAdd from './components/Customer/customerAdd.vue';
// import myCusEdit from './components/Customer/myCusEdit.vue';
// import Blacklist from './components/Customer/Blacklist.vue';
import ReturnVisitCustomers from './components/Customer/ReturnVisitCustomers.vue'; //回访客户
// import ReViCustomerEdit from './components/Customer/ReViCustomerEdit.vue'; //回访客户编辑
// import SendOutCustomers from './components/Customer/SendOutCustomers.vue'; //外发客户
// import ServiceEvaluation from './components/Customer/ServiceEvaluation.vue'; //合规服务评价
//排行榜
// import Leaderboard from './components/Leaderboard/Leaderboard.vue';
// //数据统计
// import dataStatistics from './components/Statistical Analysis/dataStatistics.vue';
// import ResEfficiency from './components/Statistical Analysis/ResEfficiency.vue';
// import newResEfficiency from './components/Statistical Analysis/newResEfficiency.vue';
// import BankAnalysis from './components/Statistical Analysis/BankAnalysis.vue';
// import PerformanceAnalysis from './components/Statistical Analysis/BankAnalysis.vue';
//财务管理
// import examine from './components/Financial Management/examine.vue';
// import examineAdd from './components/Financial Management/examineAdd.vue';
// import examineEdit from './components/Financial Management/examineEdit.vue';
// import FinExamine from './components/Financial Management/FinExamine.vue';
//运营管理
// import SourceStatistics from './components/Operation Management/SourceStatistics.vue';
// import SupplyConfiguration from './components/Operation Management/SupplyConfiguration.vue';
// import rechargeDeplete from './components/Operation Management/rechargeDeplete.vue';
// import rechargeRecord from './components/Operation Management/rechargeRecord.vue';
// import PromotionAnalysis from './components/Operation Management/PromotionAnalysis.vue';
// import toBReport from './components/Operation Management/toBReport.vue';
// import popularizeAnalysis from './components/Operation Management/popularizeAnalysis.vue';
// import PublicDaataReport from './components/Operation Management/PublicDaataReport.vue';  //新版对公数据报表
// import SendOutManagement from './components/Operation Management/SendOutManagement.vue';  //外发管理
//部门管理
// import department from './components/Department Management/department.vue';
// import employeeAdd from './components/Department Management/employeeAdd.vue';
// import employeeEdit from './components/Department Management/employeeEdit.vue';
// import HRemployeeEdit from './components/Department Management/HRemployeeEdit.vue';
//财务用加盟充值记录
// import FinRechargeRecord from './components/FinRechargeRecord.vue';
// import dataAnalysis from './components/dataAnalysis.vue';
//日志管理
// import MyLog from './components/LogManagement/MyLog.vue';
// import TeamLog from './components/LogManagement/TeamLog.vue';
// import EditLog from './components/LogManagement/EditLog.vue';
//行政人员页面
// import OnSiteCustomer from './components/Administrative/OnSiteCustomer.vue';
//通话管理页面
// import CallRecords from './components/CallRecordManagement/CallRecords.vue';
//进件助理模块
// import WorkLog from './components/AssistantManager/WorkLog.vue';
// import QuDaoEditLog from './components/AssistantManager/QuDaoEditLog.vue';
//个人设置
// import userSetting from './components/user/userSetting.vue';
// 路由规则
const routes = [
  {
    path: '/login',
    component: login,
    // component: () =>import('@/components/login.vue'),
    name: 'login',
        meta: {
          // title: '登陆'
        }
  },
  {
    path: '/',
    // component: index,
    component: () => import('./components/index.vue'),
    children: [
      {
        path: '', // 重定向
        redirect: '/myCustomer',
        meta: {
          title: '我的客户'
        }
      },
      {
        path: 'myCustomer', // 客户
        // component: myCustomer,
        component: () =>import('./components/Customer/myCustomer.vue'),
        name: ' myCustomer',
        title: '我的客户',meta: {name: '我的客户'}
      },
      {
        path: 'customerList', // 客户列表
        // component: customerList,
        component: () => import('./components/Customer/customerList.vue'),
        name: ' customerList',
        title: '客户列表',meta: {name: '客户列表',}
      },
      {
        path: 'teamCus', // 团队客户
        component: () => import('./components/Customer/teamCus.vue'),
        // component: teamCus,
        name: ' teamCus',
        title: '团队客户',meta: {name: '团队客户'}
      },
      {
        path: 'Blacklist', // 黑名单管理
        component: () => import('./components/Customer/Blacklist.vue'),
        name: ' Blacklist',
        title: '黑名单管理',meta: {name: '黑名单管理'}
      },
      {
        path: 'ReturnVisitCustomers', // 回访客户
        // component: ReturnVisitCustomers,
        component: () => import('./components/Customer/ReturnVisitCustomers.vue'),
        name: ' ReturnVisitCustomers',
        title: '回访客户',meta: {name: '回访客户'}
      },
      {
        path: 'ReViCustomerEdit', // 回访客户编辑
        component: () => import('./components/Customer/ReViCustomerEdit.vue'),
        // component: ReViCustomerEdit,
        name: ' ReViCustomerEdit',
        title: '回访客户编辑',meta: {name: '回访客户编辑'}
      },
      {
        path: 'SendOutCustomers', // 外发客户
        // component: SendOutCustomers,
        component: () => import('./components/Customer/SendOutCustomers.vue'),
        name: ' SendOutCustomers',
        title: '外发客户',meta: {name: '外发客户'}
      },
      {
        path: 'redistribution', // 再分配客户
        // component: redistribution,
        component: () => import('./components/Customer/redistribution.vue'),
        name: ' redistribution',
        title: '再分配客户',meta: {name: '再分配客户'}
      },
      {
        path: 'dataAnalysis', // 数据分析
        // component: dataAnalysis,
        component: () => import('./components/dataAnalysis.vue'),
        name: ' dataAnalysis',
        title: '数据分析',meta: {name: '数据分析'}
      },
      {
        path: 'Leaderboard', // 业绩排行
        // component: Leaderboard,
        component: () => import('./components/Leaderboard/Leaderboard.vue'),
        name: ' Leaderboard',
        title: '业绩排行',meta: {name: '业绩排行'}
      },
      {
        path: 'examine', // 在审件管理
        // component: examine,
        component: () => import('./components/Financial Management/examine.vue'),
        name: ' examine ',
        title: '在审件管理',meta: {name: '在审件管理'}
      },
      {
        path: 'examineAdd', // 添加在审件页面
        // component: examineAdd,
        component: () => import('./components/Financial Management/examineAdd.vue'),
        name: ' examineAdd',
        title: '添加在审件',meta: {name: '添加在审件'}
      },
      {
        path: 'examineEdit', // 编辑在审件页面
        // component: examineEdit,
        component: () => import('./components/Financial Management/examineEdit.vue'),
        name: ' examineEdit',
        title: '编辑在审件',meta: {name: '编辑在审件'}
      },
      {
        path: 'dataStatistics', // 数据统计
        component: () => import('./components/Statistical Analysis/dataStatistics.vue'),
        name: ' dataStatistics',
        title: '数据统计',meta: {name: '数据统计'}
      },
      {
        path: 'department', // 部门管理
        // component: department,
        component: () => import('./components/Department Management/department.vue'),
        name: ' department',
        title: '部门管理',meta: {name: '部门管理'}
      },
      {
        path: 'employeeEdit', // 人员编辑页面
        // component: employeeEdit,
        component: () => import('./components/Department Management/employeeEdit.vue'),
        name: ' employeeEdit',
        title: '人员编辑',meta: {name: '人员编辑'}
      },
      {
        path: 'employeeAdd', // 人员编辑页面
        // component: employeeAdd,
        component: () => import('./components/Department Management/employeeAdd.vue'),
        name: ' employeeAdd',
        title: '人员新增',meta: {name: '人员新增'}
      },
      {
        path: 'myCusEdit/', // 团队客户编辑页面
        // path: 'myCusEdit/:CusName/:CusId/:addatbn', // 团队客户编辑页面
        // component: myCusEdit,
        component: () => import('./components/Customer/myCusEdit.vue'),
        name: ' myCusEdit',
        title: '编辑客户',meta: {name: '编辑客户',
          // noTabe
        }
      },
      {
        path: 'customerAdd', // 添加客户页面
        // component: customerAdd,
        component: () => import('./components/Customer/customerAdd.vue'),
        name: ' customerAdd',
        title: '添加客户',meta: {name: '添加客户'}
      },
      {
        path: 'SourceStatistics', // 来源管理
        // component: SourceStatistics,
        component: () => import('./components/Operation Management/SourceStatistics.vue'),
        name: ' SourceStatistics',
        title: '来源管理',meta: {name: '来源管理'}
      },
      {
        path: 'rechargeDeplete', // 充值消耗
        // component: rechargeDeplete,
        component: () => import('./components/Operation Management/rechargeDeplete.vue'),
        name: ' rechargeDeplete',
        title: '充值消耗',meta: {name: '充值消耗'}
      },
      {
        path: 'rechargeRecord', // 数据充值记录
        // component: rechargeRecord,
        component: () => import('./components/Operation Management/rechargeRecord.vue'),
        name: ' rechargeRecord',
        title: '数据充值记录',meta: {name: '数据充值记录'}
      },
      {
        path: 'toBReport', // 对公数据报表
        // component: toBReport,
        component: () => import('./components/Operation Management/toBReport.vue'),
        name: ' toBReport',
        title: '对公数据报表',meta: {name: '对公数据报表'}
      },
      {
        path: 'PublicDaataReport', // 新版对公数据报表  NEW！！！
        // component: PublicDaataReport,
        component: () => import('./components/Operation Management/PublicDaataReport.vue'),
        name: ' PublicDaataReport',
        title: '新版对公数据报表',meta: {name: '新版对公数据报表'}
      },
      {
        path: 'SendOutManagement', // 外发管理 ！
        // component: SendOutManagement,
        component: () => import('./components/Operation Management/SendOutManagement.vue'),
        name: ' SendOutManagement',
        title: '外发管理',meta: {name: '外发管理'}
      },
      {
        path: 'ResEfficiency', // 数据处理效率
        // component: ResEfficiency,
        component: () => import('./components/Statistical Analysis/ResEfficiency.vue'),
        name: ' ResEfficiency',
        title: '数据处理效率',meta: {name: '数据处理效率'}
      },
      {
        path: 'newResEfficiency', // 数据处理效率
        // component: newResEfficiency,
        component: () => import('./components/Statistical Analysis/newResEfficiency.vue'),
        name: 'newResEfficiency',
        title: '新数据处理效率',meta: {name: '新数据处理效率'}
      },
      {
        path: 'BankAnalysis', // 进件银行分析
        // component: BankAnalysis,
        component: () => import('./components/Statistical Analysis/BankAnalysis.vue'),
        name: ' BankAnalysis',
        title: '进件银行分析',meta: {name: '进件银行分析'}
      },
      {
        path: 'FinExamine', // 业绩管理
        component: () => import('./components/Financial Management/FinExamine.vue'),
        name: ' FinExamine',
        title: '业绩管理',meta: {name: '业绩管理'}
      },
      {
        path: 'SupplyConfiguration', // 供量配置
        // component: SupplyConfiguration,
        component: () => import('./components/Operation Management/SupplyConfiguration.vue'),
        name: ' SupplyConfiguration',
        title: '供量配置',meta: {name: '供量配置'}
      },
      {
        path: 'PromotionAnalysis', // 申请跑量分析
        // component: PromotionAnalysis,
        component: () => import('./components/Operation Management/PromotionAnalysis.vue'),
        name: ' PromotionAnalysis',
        title: '申请跑量分析',meta: {name: '申请跑量分析'}
      },
      {
        path: 'PerformanceAnalysis', // 业绩数据分析
        // component: PerformanceAnalysis,
        component: () => import('./components/Statistical Analysis/BankAnalysis.vue'),
        name: ' PerformanceAnalysis',
        title: '业绩数据分析',meta: {name: '业绩数据分析'}
      },
      {
        path: 'FinRechargeRecord', // 加盟充值记录（财务）
        // component: FinRechargeRecord,
        component: () => import('./components/FinRechargeRecord.vue'),
        name: ' FinRechargeRecord',
        title: '充值记录',meta: {name: '充值记录'}
      },
      {
        path: 'UnhandleM', // 待处理客户
        component: () => import('./components/Customer/UnhandleM.vue'),
        name: ' UnhandleM',
        title: '待处理客户',meta: {name: '待处理客户'}
      },
      {
        path: 'UnhandleR', // 再分配待处理客户
        component: () => import('./components/Customer/UnhandleR.vue'),
        // component: UnhandleR,
        name: ' UnhandleR',
        title: '再分配待处理客户',meta: {name: '再分配待处理客户'}
      },
      {
        path: 'UnhandleT', // 团队待处理客户
        component: () => import('./components/Customer/UnhandleT.vue'),
        name: ' UnhandleT',
        title: '团队待处理客户',meta: {name: '团队待处理客户'}
      },
      {
        path: 'MyLog', // 我的日志
        // component: MyLog,
        component: () => import('./components/LogManagement/MyLog.vue'),
        name: ' MyLog',
        title: '我的日志',meta: {name: '我的日志'}
      },
      {
        path: 'TeamLog', // 团队日志
        // component: TeamLog,
        component: () => import('./components/LogManagement/TeamLog.vue'),
        name: ' TeamLog',
        title: '团队日志',meta: {name: '团队日志'}
      },
      {
        path: 'EditLog', // 编辑日志
        // component: EditLog,
        component: () => import('./components/LogManagement/EditLog.vue'),
        name: ' EditLog',
        title: '编辑日志',meta: {name: '编辑日志'}
      },
      {
        path: 'popularizeAnalysis', // 推广分析
        // component: popularizeAnalysis,
        component: () => import('./components/Operation Management/popularizeAnalysis.vue'),
        name: ' popularizeAnalysis',
        title: '推广分析',meta: {name: '推广分析'}
      },
      {
        path: 'OnSiteCustomer', // 上门客户
        // component: OnSiteCustomer,
        component: () => import('./components/Administrative/OnSiteCustomer.vue'),
        name: 'OnSiteCustomer',
        title: '上门客户',meta: {name: '上门客户'}
      },
      {
        path: 'CallRecords', // 通话管理
        // component: CallRecords,
        component: () => import('./components/CallRecordManagement/CallRecords.vue'),
        name: 'CallRecords',
        title: '通话管理',meta: {name: '通话管理'}
      },
      {
        path: 'WorkLog', // 工作日志
        // component: WorkLog,
        component: () => import('./components/AssistantManager/WorkLog.vue'),
        name: 'WorkLog',
        title: '工作日志',meta: {name: '工作日志'}
      },
      {
        path: 'QuDaoEditLog', // 编写日志（渠道）
        // component: QuDaoEditLog,
        component: () => import('./components/AssistantManager/QuDaoEditLog.vue'),
        name: 'QuDaoEditLog',
        title: '编写日志（渠道）',meta: {name: '编写日志（渠道）'}
      },
      {
        path: 'HRemployeeEdit', // HR专用编辑页面
        // component: HRemployeeEdit,
        component: () => import('./components/Department Management/HRemployeeEdit.vue'),
        name: ' HRemployeeEdit',
        title: 'HR专用编辑页面',meta: {name: 'HR专用编辑页面'}
      },
      {
        path: 'ServiceEvaluation', //回访统计
        // component: ServiceEvaluation,
        component: () => import('./components/Customer/ServiceEvaluation.vue'),
        name: ' ServiceEvaluation',
        title: '回访统计',meta: {name: '回访统计'}
      },
      {
        path: 'userSetting', // HR专用编辑页面
        // component: userSetting,
        component: () => import('./components/user/userSetting.vue'),
        name: 'userSetting',
        title: '账号设置',meta: {name: '账号设置'}
      },
      {
        path: 'lotterySetting', // 抽奖设置
        // component: userSetting,
        component: () => import('./components/user/lottery.vue'),
        name: 'lottery',
        title: '抽奖设置',meta: {name: '抽奖设置'}
      },
      {
        path: 'lotteryRes', // 抽奖设置
        // component: userSetting,
        component: () => import('./components/user/lotteryRes.vue'),
        name: 'lottery',
        title: '抽奖结果',meta: {name: '抽奖结果'}
      },
      {
        path: 'Unsigned', // 上门未签约
        // component: userSetting,
        component: () => import('./components/Customer/UnsignedH.vue'),
        name: 'Unsigned',
        title: '上门未签约',meta: {name: '上门未签约'}
      },
      {
        path: 'HomeCustomerEdit', // 上门未签约编辑
        component: () => import('./components/Customer/HomeCustomerEdit.vue'),
        name: 'HomeCustomerEdit',
        title: '上门未签约编辑',meta: {name: '上门未签约编辑'}
      },
      {
        path: 'lotterySetting', // 抽奖设置
        // component: userSetting,
        component: () => import('./components/user/lottery.vue'),
        name: 'lottery',
        title: '抽奖设置',meta: {name: '抽奖设置'}
      },
      {
        path: 'announcement', // 抽奖设置
        // component: userSetting,
        component: () => import('./components/user/announcement.vue'),
        name: 'announcement',
        title: '公告设置',meta: {name: '公告设置'}
      },
      {
        path: 'lotteryRes', // 抽奖设置
        // component: userSetting,
        component: () => import('./components/user/lotteryRes.vue'),
        name: 'lottery',
        title: '抽奖结果',meta: {name: '抽奖结果'}
      },
      {
        path: 'Remarks', // 备注跳转
        // component: userSetting,
        component: () => import('./components/user/Remarks.vue'),
        name: 'Remarks',
        title: '备注处理',meta: {name: '备注处理'}
      }
    ]
  }
]

//路由拦截器
// router.beforeEach((to, from, next) => {
//   //根据本地信息是否被更改
//   if (window.sessionStorage.getItem("currentName") == null) {
//     this.$message.warning("请先进行登录操作！");
//     this.$router.push("login");
//   } else {
//       next()//若点击的是不需要验证的页面,则进行正常的路由跳转
//   }
// });
// 实例化路由对象
const router = new VueRouter({
  base:"/CRM/",
  mode:"history",
  // mode:"hash",
  routes
})

// 暴露出去
export default router
